<template>
  <div class="box">
    <Homehead />
    <div>
      <van-tabs v-model="activeName" background="#e4e4e4">
        <van-tab
          v-for="category in categoryList"
          :key="category.id"
          :title="category.name"
        >
        </van-tab>
      </van-tabs>
    </div>
  </div>
</template>

<script>
import Homehead from "../../components/Homehead";
// import Postcenter from "../../components/Postcenter";
export default {
  components: { Homehead },
  data() {
    return {
      activeName: 0,
      //栏目列表
      categoryList: [],
      //文章列表
      postList: [],
    };
  },
  // 生命周期
  created() {
    this.$axios({
      url: "category",
    }).then((res) => {
      // console.log(res.data);
      this.categoryList = res.data.data;
    });
  },
  mounted() {
    this.$axios({
      url: "post",
    }).then((res) => {
      console.log(res.data.data);
    });
  },
};
</script>

<style lang="less" scoped>
.box {
  .jiantou {
    transform: rotate(45deg);
    .iconjiantou {
      font-size: 20/360 * 100vw;
    }
  }
}
</style>